<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var str = '  hello world '
        // var str = new String('hello world')

        console.log(str.length)

        console.log(str.charAt(1))
        console.log(str.indexOf('o'))
        console.log(str.toUpperCase())
        console.log(str.substring(1,4)) // 左闭右开
        console.log(str.substring(1))
        console.log(str.replace('e', '8'))
        console.log(str.split(' '))
        console.log(str.trim())

    </script>
</body>
</html>